package cn.easyutil.project.web.configuration;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

@Component
@ConfigurationProperties(prefix = "easyweb")
public class EasyProjectWebConfiguration {

    /** 是否开启redis存储用户信息*/
    private boolean enableRedis;

    /** 是否开启对参数进行加解密*/
    private boolean enableAuth;

    /** 加解密标识（请求的最后一级路径前缀）*/
    private String enableAsLastUriPrefix;

    /** 项目约定好的统一请求前缀*/
    private String uriPrefix;

    /** 请求头中的token对应的key名称*/
    private String tokenName;

    /** 登陆接口，如果配置的话，每次拦截请求的时候会判断用户是否已登陆*/
    private String loginUrl;

    /** 请求成功返回的状态码*/
    private Integer successCode;

    /** 请求失败返回的状态码*/
    private Integer errorCode;

    public boolean isEnableAuth() {
        return enableAuth;
    }

    public void setEnableAuth(boolean enableAuth) {
        this.enableAuth = enableAuth;
    }

    public String getEnableAsLastUriPrefix() {
        return enableAsLastUriPrefix;
    }

    public void setEnableAsLastUriPrefix(String enableAsLastUriPrefix) {
        this.enableAsLastUriPrefix = enableAsLastUriPrefix;
    }

    public String getUriPrefix() {
        return uriPrefix;
    }

    public void setUriPrefix(String uriPrefix) {
        this.uriPrefix = uriPrefix;
    }

    public String getTokenName() {
        return tokenName;
    }

    public void setTokenName(String tokenName) {
        this.tokenName = tokenName;
    }

    public String getLoginUrl() {
        return loginUrl;
    }

    public void setLoginUrl(String loginUrl) {
        this.loginUrl = loginUrl;
    }

    public boolean isEnableRedis() {
        return enableRedis;
    }

    public void setEnableRedis(boolean enableRedis) {
        this.enableRedis = enableRedis;
    }

    public Integer getSuccessCode() {
        return successCode;
    }

    public void setSuccessCode(Integer successCode) {
        this.successCode = successCode;
    }

    public Integer getErrorCode() {
        return errorCode;
    }

    public void setErrorCode(Integer errorCode) {
        this.errorCode = errorCode;
    }
}
